package main

import (
	"fmt"
	"time"
)

func main() {
	//数组定义，类似于c语言
	//以前的c语言的数组定义
	//int a[10];
	//现在go的数组的定义
	var b [5]int
	fmt.Println(b)
	var c [2][2]int
	fmt.Println(c)

	a := [3]int{12, 12, 12}
	fmt.Println(a)

	//数组的初始化
	myArray := [5]int{1, 2, 3, 4, 5}

	myarray2 := myArray
	fmt.Println("直接赋值过来的数组", myarray2)

	for i, value := range myArray {
		fmt.Println(i, value)
	}

	//遍历数组
	for i := 0; i < len(myArray); i++ {
		fmt.Print(myArray[i])
		myArray[i] = myArray[i] + 100
		fmt.Println("修改之后", myArray[i])
	}

	for range myArray {
		fmt.Println("for range 遍历数组")
	}

	var number int
	number = 2
	if number >= 2 {
		fmt.Println("满足条件=", number)
	} else {
		fmt.Println("不满足条件=", number)
	}
	today := time.Now().Weekday()
	fmt.Println(today)
	switch today.String() {
	case "Wednesday":
		fmt.Println("today is 周三")
		fallthrough
	case "Friday":
		fmt.Println("today is 周五")
		fallthrough
	default:
		fmt.Println("未知")

	}

}
